import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-04-03
 * Time: 22:58
 */
public class Test {
    public static void main(String[] args) {
        String s = "马大帅哥";
        byte[] bytes = s.getBytes();
        System.out.println(Arrays.toString(bytes));
        System.out.println(new String(bytes, 0, bytes.length));
        System.out.println(bytes.length);

        String str = "马大帅哥";
        char[] chars = new char[str.length()];
        
        str.getChars(0, str.length(), chars, 0);
        System.out.println(Arrays.toString(chars));
        System.out.println(chars.length);
    }
}
